﻿using WalkingTec.Mvvm.Core;

namespace ReaWTM.LayuiHelper
{
	public static class ColumnFormatInfoExtension
	{
		public static ColumnFormatInfo MakeTag(object text, BgColorEnum? color = null, TagStyle tagStyle = TagStyle.Normal)
		{
			var tag = "";
			var str_color = color == null ? "" : $"layui-bg-{color.ToString().ToLower()}";
			switch (tagStyle)
			{
				case TagStyle.Normal:
					{
						tag = "layui-badge";
						break;
					}
				case TagStyle.Dot:
					{
						tag = "layui-badge-dot";
						break;
					}
				case TagStyle.Rim:
					{
						tag = "layui-badge-rim";
						break;
					}
			}
			var self = ColumnFormatInfo.MakeHtml($"<span class='{tag} {str_color}'>{text}</span>");
			return self;
		}
	}
}
